package org.dong.test;

import org.dong.Mapper.OrderMapper;
import org.dong.Mapper.ReceptionMapper;
import org.dong.Mapper.UserMapper;
import org.dong.Tool.ApplicationUtil;
import org.dong.Tool.BarcodeGeneratorUtil;
import org.dong.Tool.Data;
import org.dong.Tool.MyBatisUtil;
import org.dong.pojo.AdminUser;
import org.dong.pojo.User;
import org.dong.pojo.qo.OrderQo;
import org.dong.service.Impl.UserServiceImpl;
import org.dong.service.ReceptionService;
import org.dong.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

import javax.annotation.Resource;
import javax.sql.DataSource;
import java.math.BigDecimal;
import java.nio.file.Path;
import java.util.List;

public class Main {

    public static void main(String[] args) {
//        AdminUser adminUser = MyBatisUtil.getSqlSession().getMapper(ReceptionMapper.class).getAdminUser("wangwu", "e10adc3949ba59abbe56e057f20f883e");
//        System.out.println(adminUser);
//        final List<OrderQo> orderList = MyBatisUtil.getSqlSession().getMapper(OrderMapper.class).getOrderList(null,null,null,null,null,0);
//        for (OrderQo orderQo : orderList) {
//            System.out.println(orderQo);
//        }
//        String barcodeData = "15"; // 条形码数据
//        String barcodeType = "CODE_128"; // 条形码类型
//
//        final String s = BarcodeGeneratorUtil.generateBarcode(barcodeData);
//        System.out.println(s);
//        String resourcePath = Main.class.getResource().getPath();
//        System.out.println("相对路径：" + resourcePath);


//        final UserService userServiceImpl = (UserService) ApplicationUtil.getContext().getBean(UserServiceImpl.class);

//        final ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
//
//        final User user1 = context.getBean(UserServiceImpl.class).getUser("350781199508080011", null);
//        final User user = userServiceImpl.getUser("350781199508080011", null);
//        System.out.println(user);
//        System.out.println(user1);

//        JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource);


    }

}
